Cytosim  PI
Cytoskeleton Simulator
MatrixSparseSymmetric1 Class Reference

Detailed Description

MatrixSparseSymmetric1 uses a sparse storage, with arrays of elements for each column. For multiplication, it uses a another format, from Numerical Recipes. The conversion is done when prepareForMultiply() is called

Inheritance diagram for MatrixSparseSymmetric1:
Matrix

Public Member Functions

unsigned int size () const
 returns the size of the matrix
 
void deallocate ()
 base for destructor
 
 MatrixSparseSymmetric1 ()
 default constructor
 
virtual ~MatrixSparseSymmetric1 ()
 default destructor
 
void makeZero ()
 set all the element to zero
 
void allocate (unsigned int sz)
 allocate the matrix to hold ( sz * sz )
 
realaddr (index_type x, index_type y) const
 returns the address of element at (x, y), no allocation is done
 
realoperator() (index_type x, index_type y)
 returns the address of element at (x, y), allocating if necessary
 
void scale (real a)
 scale the matrix by a scalar factor
 
void addDiagonalBlock (real *M, index_type x, unsigned int sx) const
 add the diagonal block ( x, x, x+sx, x+sx ) from this matrix to M
 
void addTriangularBlock (real *M, index_type x, unsigned int sx) const
 add the upper triagular block ( x, x, x+sx, x+sx ) from this matrix to M
 
void prepareForMultiply ()
 optional optimization that may accelerate multiplications by a vector
 
void vecMulAdd (const real *X, real *Y) const
 multiplication of a vector: Y = Y + M * X, dim(X) = dim(M)
 
void vecMulAddIso2D (const real *X, real *Y) const
 2D isotropic multiplication of a vector: Y = Y + M * X
 
void vecMulAddIso3D (const real *X, real *Y) const
 3D isotropic multiplication of a vector: Y = Y + M * X
 
bool nonZero () const
 true if matrix is non-zero
 
unsigned int nbNonZeroElements () const
 number of element which are non-zero
 
std::string what () const
 returns a string which a description of the type of matrix
 
void printSparse (std::ostream &) const
 printf debug function in sparse mode: i, j : value
 
int bad () const
 debug function
 
- Public Member Functions inherited from Matrix
 Matrix ()
 empty constructor
 
virtual ~Matrix ()
 empty destructor
 
real value (index_type x, index_type y) const
 returns the value of element at (x, y) or zero if not allocated
 
void copyBlock (real *M, index_type x, unsigned int sx, index_type y, unsigned int sy) const
 copy the block ( x, y, x+sx, y+sy ) from this matrix into M
 
virtual void vecMul (const real *X, real *Y) const
 Vector multiplication: Y <- M * X, size(X) = size(Y) = size(M)
 
virtual real maxNorm () const
 maximum absolute value considering all the elements
 
virtual void printFull (std::ostream &) const
 printf debug function in full lines, all columns
 

Additional Inherited Members

- Public Types inherited from Matrix
typedef unsigned int index_type
 type of an index into the matrix